package com.syl.practice.nullValue.equal;

import java.util.Objects;

public class EqualTest {

    public static void main(String[] args) {
        demo01();
    }

    /**
     * JDK1.7提供方法，比较两个对象是否相等
     */
    public static void demo01() {
        String str01 = "abc";
        String str02 = new String("abc");
        System.out.println(str01 == str02);
        boolean flag = Objects.equals(str01, str02);
        System.out.println(flag);
    }


}
